<%--
  Created by IntelliJ IDEA.
  User: admin666
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<head>
    <title>Title</title>
    <style>
        *{
            user-select: none;
            /* 无法选中，整体感更强 */
        }

        body{
            background-image: url("../usermanagement_page/wallpaper.jpg");
            background-size: cover;
            background-attachment: fixed;
        }

        .login{
            position: absolute;
            top: 30%;
            margin-top: -100px;
            left: 50%;
            margin-left: -200px;
            /* absolute居中的一种方法 */
            background-color: whitesmoke;
            width: 400px;
            height: 600px;
            border-radius: 25px;
            text-align: center;
            padding: 5px 40px;
            box-sizing: border-box;
            /* 这样padding就不会影响大小 */
        }

        p{
            font-size: 42px;
            font-weight: 600;
        }

        input{
            background-color: whitesmoke;
            width: 100%;
            height: 48px;
            margin-bottom: 10px;
            border: none;
            border-bottom: 2px solid silver;
            /* 下面的会覆盖上面的步伐 */
            outline: none;
            font-size: 22px;
        }

        .btn{
            background-color: #59c2c5;
            width: 38%;
            height: 48px;
            border-radius: 8px;
            margin-top: 40px;
            font-size: 28px;
            font-weight: 600;
            color: white;
        }
        .btn:hover{
            background-color: #59c2a0;
        }
    </style>
</head>
<body>
<h1 style="text-align: center">添加场馆页面</h1>

<div class="login">
    场馆名: <input id="input1" type="text" name="username"/><br>
    场馆数量: <input id="input2" type="number" name="password"/><br>
    场馆描述: <input id="input3" type="text" name="phone"/><br>
    租赁价格: <input id="input4" type="number" name="gender"/><br>
    限制人数 <input id="input5" type="number" name="eam"/><br>
    <input class="btn" type="button" id="btn01" value="添加">
</div>
<%--<form action="/glh/register" method="get">--%>

<a href="http://localhost:8080/stadium/reservation_page/manager.html">点我返回管理页面</a>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.7.0.js"></script>
<script>
    var student={};
    var arr=[];
    $(function(){
        $("#btn01").click(function(){
            var sn=$("#input1").val();
            var ss=$("#input2").val();
            var des=$("#input3").val();
            var pri=$("#input4").val();
            var co=$("#input5").val();

            var user={"stadiumName":sn,"stadiumNum":ss,"description":des,"rentalPrice":pri,"limitNum":co};
            $.ajax({
                type:"post",
                url:"http://localhost:8080/stadium/admin/addStadium",
                data:JSON.stringify(user),
                dataType:"json",
                success:function(data) {
                    if(data == 1)
                    window.alert("提交成功")
                }
            })
        })
    })
</script>
<body>


